package cn.fx.exception;

import cn.fx.exception.enums.GlobalEnum;
import lombok.Data;

@Data
public class GloobalMadeException extends RuntimeException{

    private String errorMessage;

    private String errorCode;

    // 无参构造
    public GloobalMadeException (){
        super();
    }

    //有参构造
    public GloobalMadeException (String message){
        super(message);
    }

    //自定义有参构造
    public GloobalMadeException(String errorMessage, String errorCode) {
        super(errorMessage);
        this.errorMessage = errorMessage;
        this.errorCode = errorCode;
    }

    //自定义有参构造
    public GloobalMadeException(GlobalEnum globalEnum) {
        super(globalEnum.getErrorMessage());
        this.errorMessage = globalEnum.getErrorMessage();
        this.errorCode = globalEnum.getErrorCode();
    }

}
